#!/bin/bash
### BEGIN INIT INFO
# Provides:          gunicorn
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Stop/start/restart gunicorn
### END INIT INFO
# Author: kun <jk409@qq.com>
PATH=/sbin:/usr/sbin:/bin:/usr/bin

args=${1-0}
case $args in
start)
cd /home/ubuntu/v1&&gunicorn --config /etc/gunicorn.conf run:app &
;;
stop)
killall gunicorn;
;;
restart)
killall gunicorn;
cd /home/ubuntu/v1&&gunicorn --config /etc/gunicorn.conf run:app &
;;
*)
echo "Usage:gunicorn.sh start|stop|restart"
;;
esac
exit 0

